package com.wechat.scheme.entity;


import com.wechat.scheme.entity.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Transient;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;

@Data
@Entity
@Table(name = "wx_button")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Where(clause = "deleted = 0")
public class WxButton extends BaseEntity {
    private String sourceAppId;

    private String type;
    private String btName;
    private String btKey;
    private String url;
    private String mediaId;
    private String appid;
    private String pagepath;
    private String pid;
    private List<WxButton> subButtons = new ArrayList();
    @Transient
    public List<WxButton> getSubButtons() {
        return subButtons;
    }
}
